home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / raytrace / radiance / nextrad.lha / NeXtRad / vector-matrix.h < prev    next >
Encoding:
Text File  |  1993-02-22  |  1.9 KB  |  57 lines

  1. /* vector-matrix.h */
  2. /* written by : Jason R. Wilson   2/21/93 */
  3.  
  4. /* this package provides basic vector and matrix manipulations */
  5.  
  6.  
  7. Vector Sub(Vector vec1, Vector vec2);
  8. /* This function returns the difference of the first and second vectors */
  9.  
  10. Vector Add(Vector vec1, Vector vec2);
  11. /* This function returns the sum of the first and second vectors */
  12.  
  13. double Length(Vector vec);
  14. /* This function returns the length of a vector */
  15.  
  16. Vector Normalize(Vector vec);
  17. /* This function returns the normalized vector parameters */
  18.  
  19. Vector Scale(Vector vec, double scale);
  20. /* scales the 3D vector (multiplies each component by the 'scale')*/
  21.  
  22. double Dotprod(Vector vec1, Vector vec2);
  23. /* This function returns the dot product of the two vectors given. */
  24.  
  25. Vector Cross(Vector vec1, Vector vec2);
  26. /* This function returns the cross product of the two vectors given. */
  27.  
  28. void Transpose (Matrix *a, Matrix *b);
  29. /* this routine puts the transpose of matrix a into matrix b */
  30.      
  31. void pointMultiply(Point a, double *b, double *c);
  32. /* Multiplies the n-1-element point, a, by the nxn matrix, b, to produce the
  33.    n-element point, c. */
  34.  
  35. void matrixMultiply (int n, double *a, double *b, double *c);
  36. /* Multiplies the nxn matrix a by the nxn matrix b to produce the nxn matrix
  37.    c. */
  38.  
  39. void createIdentity (int n, double *a);
  40. /* Creats an nxn identity matrix in a. */
  41.  
  42. void matrixCopy (double *a, double *b);
  43. /* copies matrix a into matrix b (assumes 4X4) */
  44.  
  45. void ProduceTransform (Point VRP,Vector u, Vector v, Vector n,
  46.                double Eye,Matrix *Composition);
  47. /* build the transform matrix that transforms coordinate systems and
  48.    does perspective projects */
  49.  
  50. void TransformView (ObjectCell *ObjectHead,Matrix Composition);
  51. /* This routine transforms every vertex into view coordinates, */
  52. /* and does perspective transformation */
  53.  
  54. void TransformObject (ObjectCell *Object);
  55. /* This routine transforms each vertex of the object from object coords. 
  56.    to world coordinates */
  57.